package com.factory.entity;

import java.util.Date;
import java.util.List;

public class Department {
    private Integer deptId;
    private String deptName;
    private String manager;
    private String location;
    private Date createTime;

    // 一对多关系：一个部门有多个员工
    private List<Employee> employees;

    // 构造方法
    public Department() {}

    public Department(String deptName, String manager, String location) {
        this.deptName = deptName;
        this.manager = manager;
        this.location = location;
    }

    // Getter和Setter方法
    public Integer getDeptId() { return deptId; }
    public void setDeptId(Integer deptId) { this.deptId = deptId; }

    public String getDeptName() { return deptName; }
    public void setDeptName(String deptName) { this.deptName = deptName; }

    public String getManager() { return manager; }
    public void setManager(String manager) { this.manager = manager; }

    public String getLocation() { return location; }
    public void setLocation(String location) { this.location = location; }

    public Date getCreateTime() { return createTime; }
    public void setCreateTime(Date createTime) { this.createTime = createTime; }

    public List<Employee> getEmployees() { return employees; }
    public void setEmployees(List<Employee> employees) { this.employees = employees; }

    @Override
    public String toString() {
        return "Department{deptId=" + deptId + ", deptName='" + deptName +
                "', manager='" + manager + "', location='" + location + "'}";
    }
}
